home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / PROBLEMS / BENCHMARK / BUBBLESORT / bubbletest / !readme next >
Text File  |  1992-09-03  |  9KB  |  363 lines

  1. Bubbletest (written by Martin Wuerthner and MUFTI)
  2. ==================================================
  3.  
  4. Test speed of different programing languages/tools on the Acorn Archimedes
  5. ==========================================================================
  6.  
  7.  
  8. Test method: Bubblesort-algorithm for a array of 1000 Integers
  9. -------------------------------------------------------------- 
  10.  
  11.  
  12. Introdution
  13. ===========
  14.  
  15.  
  16. This programs are written, to find out, how fast are the different programing
  17. languages/tools are.
  18. The results may help people to decide, what language/tool they should use,
  19. if they have a time-intensive problem.
  20. To make the programs easy to produce and easy to understand, I decided to use
  21. a very simple algorithm.
  22. It should be one of the type: short code, long distant runner.
  23.  
  24. The test method is a bubblesort-algorithm for a array of 1000 Integers. 
  25.  
  26. In the worst case, bubblesort needs n*n swap-operations.
  27. This give here 1 000 000 Swap-operations which is enough for running the 
  28. fastest program (currently written in assembler) and not too much for the 
  29. slowest program (currently written in gawk).
  30.  
  31. Testing data and result works via redirection of standartoutput to a file. 
  32.  
  33. Users of languages on the acorn archimedes, we can't program, or don't use
  34. the compiler/assembler/interpreter are wellcome to program such a test for 
  35. the 1000 Integer Bubblesort.
  36. If you want to join the results, here please use the same algorithm for the 
  37. integerfield:
  38.  
  39. a very simple pseudorandom algorithm:
  40.  
  41.  pseudorandom=123456;
  42.  for (count=0;count<1000;count++)
  43.     {
  44.     pseudorandom=(pseudorandom + 234567) % 567 + 345
  45.     array[count]=pseudorandom;
  46.     }
  47.  
  48.   /* this is C-syntax, % means the modulo -operation */
  49.  
  50. Print the unsorted array to the screen, each number seperated by a newline
  51.  
  52. execute (C-syntax) system("time") 
  53.  
  54. call your bubblesort routine
  55.  
  56. execute (C-syntax) system("time") 
  57.  
  58. Print the sorted array to the screen, each number seperated by a newline
  59.  
  60. thats all.
  61.  
  62.  
  63. There is a "prove" -program, which tests, if your data and result is the same
  64. as mine.
  65.  
  66. For faster tools there is a program named "time1", which support a 
  67. systemvariable time1 with centiseconds. For this you need the "prove2" -program.
  68.  
  69. The files are arranged in the following way:
  70.  
  71. 1 Directory per Language (e.g. Basic, Assembler ...)
  72.  
  73. in a directory:
  74.  
  75. !run     script to start execution of program 
  76. makeprog script to tokenize/compile/assemble the program (if needed)
  77. maketime output of makeprog tells you who long is tokenize/compile/assemble time
  78. program  tokenized/compiled/assembled image of the program       
  79. source   source of the program (in ascii) 
  80. time     tells you how long your program took for the bubblesort 
  81. output   file with program output
  82. input    extra input file, if you need some
  83. timer    extra obey file with *time-command, if you need some
  84.  
  85. !run     
  86.          should include something like the following to test result and 
  87.          generate "time" (for tool xxx):
  88.  
  89.          *if "<xxx$path>"="" then error 1 xxx$path not set ! set xxx$path       
  90.          set bubble_xxx$dir <obey$dir>
  91.  
  92.          | if you need centiseconds
  93.          if "<time1>" = "" then run <bubbletest$dir>.Time1 
  94.  
  95.          <xxx$path>xxx <bubble_xxx$dir>.program { > <bubble_xxx$dir>.output } 
  96.  
  97.          set bubbletest$dir <obey$dir>.^
  98.  
  99.          | if you need centiseconds
  100.          <bubbletest$dir>.prove2 <bubble_xxx$dir>.output [<number>] { > <bubble_xxx$dir>.time }
  101.          |else
  102.          <bubbletest$dir>.prove <bubble_xxx$dir>.output [<number>] { > <bubble_xxx$dir>.time }
  103.          settype <bubble_xxx$dir>.time text
  104.          <bubble_xxx$dir>.time
  105.  
  106.          | <number> is optional and is only needed, if your tool outputs 
  107.          | <number> lines before it starts the execution of your program 
  108.  
  109. makeprog 
  110.          should include something like the following to generate "maketime" 
  111.          (for tool xxx):
  112.          set bubble_xxx$dir <obey$dir>
  113.          time { > <bubble_xxx$dir>.maketime }
  114.  
  115.          compile/tokenize/assembler <bubble_xxx$dir>.source <bubble_xxx$dir>.program        
  116.  
  117.          time { >> <bubble_xxx$dir>.maketime }
  118.          settype <bubble_xxx$dir>.maketime text
  119.          <bubble_xxx$dir>.maketime
  120.  
  121.  
  122. Here are the results on a ARM2 (tokenize/compile/assemble -time counts for
  123. ramdisc)
  124.  
  125.  
  126. ==============================================================================
  127.  
  128. language:
  129.    ARM assembler (optimized)
  130. tool:
  131.    TLA
  132.  
  133. needed software for execution: 
  134.    -
  135. time for execution:
  136.    ~2.32 sec
  137.  
  138. needed software for assembling: 
  139.    TLA0.1h             (set tla$path)
  140.    clib - module
  141.    fpemulator - module
  142. time for assembling
  143.    ~3 sec
  144.  
  145. note: the macros in bubbletest.assembler.needed are freeware (not public 
  146.       domain)
  147.       (only the messured bubblesort routine is exclusive optimized assembler)
  148. ==============================================================================
  149.  
  150. language:
  151.    ARM assembler 
  152. tool:
  153.    TLA
  154.  
  155. needed software for execution: 
  156.    -
  157. time for execution:
  158.    ~2.60 sec
  159.  
  160. needed software for assembling: 
  161.    TLA0.1h             (set tla$path)
  162.    clib - module
  163.    fpemulator - module
  164. time for assembling
  165.    ~3 sec
  166.  
  167. note: the macros in bubbletest.assembler.needed are freeware (not public 
  168.       domain)
  169.       (only the messured bubblesort routine is exclusive optimized assembler)
  170. ==============================================================================
  171.  
  172. language:
  173.    C (optimized)
  174. tool:
  175.    ansi-C version 4
  176.  
  177. needed software for execution: 
  178.    clib - module   
  179.  
  180. time for execution:
  181.    ~2.72 sec
  182.  
  183. needed software for compiling: 
  184.    C compiler package
  185.  
  186. time for preprocessor/assembling
  187.    ~5 sec
  188.  
  189. ==============================================================================
  190.  
  191. language:
  192.    C 
  193. tool:
  194.    ansi-c version 4
  195.  
  196. needed software for execution: 
  197.    clib - module   
  198.  
  199. time for execution:
  200.    ~3-4 sec
  201.  
  202. needed software for preprocessor/assembling: 
  203.    C compiler package
  204.  
  205. time for preprocessor/assembling
  206.    ~5 sec
  207.  
  208. ==============================================================================
  209.  
  210. language:
  211.    - (optimized)
  212. tool:
  213.    formula007 BETA  
  214.  
  215. needed software for execution: 
  216.    -
  217.  
  218. time for execution:
  219.    ~4.65 sec
  220.  
  221. needed software for preprocessor/assembling:
  222.    iconx version 8.00       (set iconx$path)
  223.    !formula version 007 BETA
  224.    tla 0.1h                 (set tla$path)
  225.  
  226. time for preprocessor/assembling
  227.    ~24 sec              (wish to have iconc on the acorn archimedes 8-( ...) 
  228.  
  229. ==============================================================================
  230.  
  231. language:
  232.    -
  233. tool:
  234.    formula version 0.69999
  235.  
  236. needed software for execution: 
  237.    -
  238.  
  239. time for execution:
  240.    ~10 sec
  241.  
  242. needed software for preprocessor/assembling: 
  243.    gawk_l            (set gawk$path/set gawk$prog)
  244.    !formula version 0.69999
  245.    tla 0.1h          (set tla$path)
  246.  
  247. time for preprocessor/assembling
  248.    ~34 sec
  249.  
  250. ==============================================================================
  251.  
  252. language:
  253.    forth 
  254. tool:
  255.    aforth compiler/interpreter 
  256.  
  257. needed software for execution: 
  258.    aforth 
  259. time for execution:
  260.    ~12-13 sec
  261.  
  262. ==============================================================================
  263.  
  264. language:
  265.    forth 
  266. tool:
  267.    tile-forth compiler/interpreter (archimedes version 2.00) 
  268.  
  269. needed software for execution: 
  270.    tile-forth version 2.00
  271.    clib - module
  272.    fpemulator - module
  273. time for execution:
  274.    ~73 sec
  275.  
  276. =============================================================================
  277.  
  278. language:
  279.    basic
  280. tool:
  281.    BBC BASIC V interpreter
  282.  
  283. needed software for execution: 
  284.    basic - module
  285. time for execution:
  286.    ~349 sec
  287.  
  288. needed software for tokenizing: 
  289.    basic -module
  290. time for tokenizing:
  291.    ~1 sec
  292.  
  293. =============================================================================
  294.  
  295. language:
  296.    icon
  297. tool:
  298.    icon8 tokenizer/interpreter
  299.  
  300. needed software for execution: 
  301.    iconx                       (set iconx$path)
  302.    clib - module
  303.    fpemulator - module
  304. time for execution:
  305.    ~820 sec    ( ~937 sec without the '<->' swap operator )
  306.  
  307. needed software for tokenizing: 
  308.    icont                       (set icont$path)
  309.    clib - module
  310.    fpemulator - module
  311. time for tokenizing:
  312.    ~2 sec
  313.  
  314. ==============================================================================
  315.  
  316. language:
  317.    perl
  318. tool:
  319.    perl interpreter
  320.  
  321. needed software for execution: 
  322.    perl                        (set perl$path)
  323.    clib - module
  324.    fpemulator - module
  325. time for execution:
  326.    ~3188 sec
  327.  
  328. ==============================================================================
  329.  
  330. language:
  331.    nawk
  332. tool:
  333.    gawk_l interpreter
  334.  
  335. needed software for execution: 
  336.    gawk_l                      (set gawk_l$path)
  337.    clib - module
  338.    fpemulator - module
  339. time for execution:
  340.    ~4939 sec
  341.  
  342. =============================================================================
  343.  
  344. language:
  345.    nawk
  346. tool:
  347.    gawk interpreter
  348.  
  349. needed software for execution: 
  350.    gawk                        (set gawk$path)
  351.    clib - module
  352.    fpemulator - module
  353. time for execution:
  354.    ~10502 sec
  355.  
  356. =============================================================================
  357.  
  358. ****************************************************************************
  359. All files here are public domain, accept bubbletest.assembler.needed, which
  360. is a conclusion of !formula.tlastatrel and !formula.functions, which are 
  361. freeware
  362. ****************************************************************************
  363.